package main

import (
	"context"
	"fmt"

	redis "github.com/redis/go-redis/v9"
)

func main() {
	var ctx = context.Background()

	clusterClient := redis.NewClusterClient(&redis.ClusterOptions{
		Addrs: []string{"node1:6379", "node2:6379", "node3:6379"}, // 指定Redis Cluster的节点地址
	})

	pong, err := clusterClient.Ping(ctx).Result()
	if err != nil {
		panic(err)
	}
	fmt.Println(pong)
}
